package com.HospitalOutpatient.controller;

import com.HospitalOutpatient.entity.Doctor;
import com.HospitalOutpatient.entity.User;

public class DoctorContext {
    private static final ThreadLocal<Doctor> DOCTOR_CONTEXT = ThreadLocal.withInitial(Doctor::new);

    public static void set(Doctor doctor) {
        if (doctor != null) {
            DOCTOR_CONTEXT.set(doctor);
        }
    }

    public static Doctor get() {
        return DOCTOR_CONTEXT.get();
    }

    public static void remove() {
        DOCTOR_CONTEXT.remove();
    }
}
